﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;

namespace Bombardiman
{
    public class Wall: GameObject
    {
        private bool destroyable;
        private Texture2D wallTexture;
        public Wall(Vector2 position, bool destructable)
            : base()
        {
            FileLoader file = FileLoader.getInstance();
            if (destructable)
                wallTexture = file.getDestructableWallTexture();
            else
                wallTexture = file.getWallTexture();
            base.Initialize(wallTexture, position, true, wallTexture.Width, wallTexture.Height);
        }

        public void Update(GameTime gameTime)
        {
            // needs edit
        }

        public void setDestroyable(bool destroyable)
        {
            this.destroyable = destroyable;
        }
        public bool isDestroyable()
        {
            return destroyable;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            // needs edit
            spriteBatch.Draw(getTexture(), getPosition(), new Rectangle(0, 0, getWidth(), getHeight()), Color.White, 0,
                    new Vector2(0, 0), 1f, SpriteEffects.None, 0);
        }
    }
}
